<?php
declare (strict_types=1);

namespace app\user\service\user\admin;

use app\common\service\BaseService;
use app\user\logic\user\FaceVerify;
use think\annotation\Inject;
use think\Request;

/**
 * Class Face
 *
 * @package app\user\service\user\admin
 */
class Face extends BaseService
{

    /**
     * @Inject()
     *
     * @var FaceVerify
     */
    private $faceVerifyLogic;

    /**
     * 用户人脸
     * Author: Martinsun <syh@sunyonghong.com>
     * Date: 2021/12/7
     *
     * @param Request $request
     * @throws \think\db\exception\DataNotFoundException
     * @throws \think\db\exception\DbException
     * @throws \think\db\exception\ModelNotFoundException
     */
    public function faceList(Request $request)
    {
        $userId   = $request->get('user_id/d');
        $sceneKey = $request->get('scene_key/s');
        $sceneId  = $request->get('scene_id/d');

        $faceList = $this->faceVerifyLogic->getUserFaceList($userId, $sceneKey, $sceneId);

        return $this->parseToData($faceList, 1);
    }
}